

import java.util.HashSet;

public class t2 {
	public static void main(String[] args) {
		String string="0100110001010001";
		HashSet<String> set = new HashSet<String>();
		for(int i=2;i<string.length();i++) {
			for(int n=0;n<string.length()-i+1;n++) {
				set.add(string.substring(n,n+i));
			}
		}
		System.out.println(set.size());
	}

}
